<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>具名slot</title>
    <script src="js/vue.js"></script>
</head>
<body>  
    <template id="t1">
        <div>
            <slot name="CPU">Intel(R)Core(TM) i7-3630QM CPU@ 2.40GHZ</slot><br>
            <slot name="Memory">金士顿 16G</slot><br>
            <slot name="GPU">ATX 3080</slot><br>
        </div>   
    </template>
    <div id="app">
        <computer>
           <div slot="GPU">ATX 4600</div>
           <div slot="CPU">Intel(R)Core(TM) i5-7800HQ CPU@ 2.40GHZ</div>
        </computer>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        components:{
            'computer':{
                template:'#t1'
            }
        }
       
    });
</script>